<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var rg =/[abc]/
    //只要包含其中的任意元素就是true
    console.log(rg.test('aff'));
    console.log(rg.test('vde'));

    console.log('----------');
    //范围符号  -
    var rg =/^[a-z]$/
    //26个英文字母包含任何1个就返回true
    console.log(rg.test('a'));
    console.log(rg.test('fasf'));
    console.log(rg.test(1));

    //包含大小写和 _ -
    var rg =/^[a-zA-Z0-9_-]$/

    //取反 [^正则表达]
  </script>
</body>
</html>
